1. Technical Field
The present invention generally relates to an improved data processing system and in particular to an improved method and system for programming in a graphic user interface. Still more particularly, the present invention relates to a method and system for debugging a program in a graphic user interface.
2. Description of the Related Art
The development of application and system software for data processing systems has traditionally been a time consuming task. The field of software engineering has attempted to overcome the limitations of traditional techniques by proposing new, more efficient software development models. Object oriented programming has emerged as a promising technology that will allow rapid development, implementation and customization of objects. Each new object has certain data attributes and processes or methods that operate on that data. Data is said to be "encapsulated" by an object and can only be modified by the object methods are invoked by sending a message to an object identifying the method and supplying any needed arguments.
Object oriented systems have two important properties in addition to encapsulation. "Inheritance" is the ability to derive a new object from an existing object and inherit all properties, including methods and data structure, from the existing object. The new object may have certain unique features which are supplied as overrides or modifications to the existing class. For example, a new subclass needs to specify only the functions and data that distinguish that class from the existing more general class.
The ability to override an existing method description enables polymorphism, the ability to have a single message to an object be processed in different ways depending on the object itself.
Inheritance and polymorphism create a powerful structure for implementing new software systems. The software developer does not have to develop each piece of a system, he or she need only specify the unique features of the system.
The power of object oriented systems is realized through the development of system "frameworks." A framework is a collection of base classes that can be used by a system implementor to create a final systems product. The framework is defined and developed to work together as a system. Conceptually, the framework is much like a set of standard hardware components used by computer hardware builders. Each of the components has certain defined functions and interfaces and the engineer assembles these components according to a particular design to create a unique hardware system.
One object oriented programming system is the System Object Model (SOM). More information on SOM can be found in SOMobjects Developer Toolkit Users Guide, Version 2.0, June 1993, available from International Business Machines Corporations.
Programming Graphic User Interfaces (GUI) has become more and more difficult. New program systems, such as Presentation Manager (PM) available from International Business Machines Corporation or Windows available from Microsoft Corporation have made GUI's easier to use, but more difficult to program. "Windows" is a trademark of Microsoft Corporation Object oriented programming has made this process easier. Visual builder systems also called "visual programming systems", such as Microsoft's Visual Basic, have made the process easier.
One possible design for a visual builder system employs an object oriented approach in which each element of a user interface, such as a window, a button, or an entry field, is treated as an object. The term "object" refers to and encapsulation of data and services that manipulate that data. Each object supports methods (such as resize), data (such as color), and events (such as button-was-pressed). Programming in such a system is done by causing an event to execute a method on an object. This type of programming can be performed visually by drawing a line from the source object, which generates the event, to a target object on which a method is executed. A user can then specify which method is to be executed as depicted in FIG. 1. With reference to FIG. 1, a diagram of a window in which visual programming may be performed is depicted. With reference to FIG. 1, graphic user interface 2 consists of a window 4 and a button 6. A user may draw a link 8 button 6 to window 4 using pointer 7 and select a method called "close". In response, selection of button 6 results in window 4 being closed. This type of interface is presented within SmallTalk Parts available from DigiTalk and VisualAge available from International Business Machines Corporation.
The term "mouse" , when used in this document, refers to any type of operating system supported graphical pointing device including, but not limited to: a mouse, trackball, light pen, touch screen, and the like. A pointing device is typically employed by a user of a data processing system to interact with a data processing system's GUI. A "pointer" is an iconic image controlled by a mouse or other such device and is displayed on the video display device of a data processing system to visually indicate to the user icons, menus, or the like that may be selected or manipulated.
Such an approach may be extended by permitting a programmer to write a script in window 9 and attach it to an event. This approach may be performed by using action objects. "Action objects" are objects that have data including name (the name of the object) and script (the program that the user types or enters) and a method called trigger that executes the program in the code. A "script" is a small piece of dynamic code that can be attached to a system of larger piece of code, such as an application. Action objects may be used as target objects using the process depicted in FIG. 1. Using this model scripts can be attached to source objects in the visual builder such as push buttons or menu items such that activating the source object triggers execution of the script.
Many times, the user may enter code that is to be used repetitively. Also, action objects may be attached to events in parts of an application that are difficult or time consuming to reach. Therefore, it would be advantageous to have a method and system to efficiently and easily test an action object.